﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace _23.Exercise
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = "eeeaaaaabbbbbcdddedssaa";
            for (int i = 0; i < text.Length-1; i++)
            {
                if (i==0)
                {
                    Console.Write(text[i]);
                    continue;
                }
                if (text[i]!=text[i-1])
                {
                    Console.Write(text[i]);
                }
            }
            //Console.WriteLine();
            //Console.WriteLine(Regex.Replace(text, @"(\w)\2+", "$1"));
            //Console.WriteLine(Regex.Replace(text, @"(\w)\1+", a => a.Groups[1].Value));
        }
    }
}
